namespace BusLib
{
    using System;

    partial class BusLibDataContext
    {
        private static BusLibDataContext _db;
        public static BusLibDataContext db
        {
            get
            {
                if (_db == null)
                {
                    _db = new BusLibDataContext(BusLib.Properties.Settings.Default.BusTrafficConnectionString);
                }
                return _db;
            }
        }

        public void Deploy()
        {
            if (DatabaseExists())
            {
                DeleteDatabase();
            }
            db.CreateDatabase();
        }
    }
}
